<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<<<<<<< HEAD
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" >

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" >

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>
	<style>
		h1{
			margin_left:20px;
		}
	</style>
</head>

<body>
<p></p>
	<div class="content-box">
        <div><h1 >license制作</h1></div>

		<div class="container">
			<form action="" class="form-horizontal">

				<div class="form-group">
					<label for=" " class="control-label col-md-1 col-sm-1">文件</label>
					<div class="col-md-8 col-sm-8">
						<input type="file" class="form-control" name="file">
						<p class="help-block">请选择上传文件</p>
					</div>
				</div>
				<div class="form-group">
					<div class="col-md-1 col-sm-1"></div>
					<div class="col-md-9 col-sm-9">
						<button class="btn btn-primary">上传文件</button>
					</div>
				</div>
			</form>
		</div>
	</div>

    <div class="tab-pane" id="tab_boot">
		<div >
			<div class="portlet light">
				<div class="portlet-body form">
					<form action="" class="form-horizontal form-bordered form-label-stripped" id="form-bootoption" method="POST">
						<div class="form-body">
							<div class="form-group">
								<label class="col-md-3 control-label">macs输入</label>
                                <div class="col-md-5">
                                    <textarea class="form-control" rows="9" name="macs"></textarea>
                                </div>
							</div>
						</div>
						<div class="form-actions">
							<div class="row">
                                <div class="col-md-offset-3 col-md-9">
                                    <button type="submit" class="btn green">保存</button>
                                </div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
	$function() {
	    $('.submit').click(function(event) {
	        event.preventDefault();
	        var file = $('.form-control').val();
	        var macs = $('.form-control').val();
	        if(file){
	            upload_file();
			}else{
	            $.ajax({
					'url':'/api/send_mac/',
					'method':'post',
					'data':{
					    'macs':macs
					},
					'success': function(data) {
                        if (data['code'] == 200) {
                            var alert = $('.alert-success');
                            alert.html('更新成功');
                            alert.show();
                        }
                    },
					'error': function(error) {
					console.log(error);
				},
				'beforeSend':function(xhr,settings) {
					var csrftoken = getCookie('csrftoken');
					//2.在header当中设置csrf_token的值
					xhr.setRequestHeader('X-CSRFToken',csrftoken);
				}//这里设置完之后就能避免csrf的攻击

				});
			}
		});
	};
//	function getScenedId(scece_name,td) {
//	    var post_data = {
//	      "name" : scene_name
//
//		};
//	    $.ajax({
//			url: {% url 'license_register' %},
//		    type:"POST",
//		    data:post_data,
//			success:function (data) {
//			    data = JSON.parse(data);
//			    if (data["status"] == 1){
//			        setSceneTd(data["result"], scece_name, td);
//				}else{
//			        alert(data["result"]);
//				}
//		    }
//		});
//	}
</script>
</html>
=======
</head>
<body>
 <p>制作license页面 </p>
</body>
</html>
>>>>>>> a363e446fec50a54a0f5ae068d446f085db515fa
